﻿using System.Collections.Generic;
using Taobao.Top.Api.Domain;
using Taobao.Top.Api.Request;

namespace Taobao.ObjectModel.Request
{
    public class Response
    {
        private readonly PageList<Item> items;
        private readonly ItemsOnsaleGetRequest request;

        public Response(ItemsOnsaleGetRequest request,PageList<Item> items)
        {
            this.items = items;
            this.request = request;
        }

        public List<Item> Result
        {
            get { return items.Content; }
        }

        public long TotalCount
        {
            get { return items.TotalResults; }
        }

        public int Count    
        {
            get { return items.Content.Count + (request.PageNo.Value-1) * request.PageSize.Value; }
        }
    }
}
